package models

type ApiCourse struct {
	CourseId           int                 `json:"course_id" gorm:"primaryKey;autoIncrement;comment:主键编码"` // 课程ID
	Name               string              `json:"name"`
	Cover              string              `json:"cover"`
	Introduction       string              `json:"introduction" comment:"课程简介"`                        //课程简介
	Announcement       string              `json:"announcement" gorm:"type:varchar(255);comment:课程公告"` //课程公告
	Contacts           string              `json:"contacts" comment:"班主任联系"`                           //班主任联系
	Curriculum         []CourseWareTree    `json:"curriculum,omitempty" gorm:"-"`
	TaskList           []CourseWareTree    `json:"task_list,omitempty" gorm:"-"`
	LearningStatistics *LearningStatistics `json:"learning_statistics,omitempty" gorm:"-"`
}

func (ApiCourse) TableName() string {
	return "sys_course"
}

type LearningStatistics struct {
	StudyToday         StudyToday
	CumulativeLearning CumulativeLearning
}

type StudyToday struct {
	TimeConsumingLearning string `json:"time_consuming_learning"`
	CompletedStudy        string `json:"completed_study"`
}

type CumulativeLearning struct {
	TimeConsumingLearning string `json:"time_consuming_learning"`
	CompletedStudy        string `json:"completed_study"`
	Progress              string `json:"progress"`
}
